
// 工单接口
import http, { method } from '../http'

const requestUrl = '/dev-api/oa/woorder'

export async function getList(params: any = {}) {
  const data = await http({
    method: method.GET,
    path: `${requestUrl}/list`,
    params,
  })
  // console.log('woorder', data)
  return data
}

/**
 * 添加
 * @param params 
 * @returns 
 */
export async function add(params: any = {}) {
  const data = await http({
    method: method.POST,
    path: requestUrl,
    params,
  })
  return data
}
/**
 * 修改
 */
export async function put(params: any = {}) {
  const data = await http({
    method: method.PUT,
    path: requestUrl,
    params,
  })
  return data
}
export async function del(id: number) {
  const data = await http({
    method: method.DELETE,
    path: `${requestUrl}/${id}`,
  })
  return data
}
// 根据id查询
export async function getById(id: number) {
  const data = await http({
    method: method.GET,
    path: `${requestUrl}/${id}`,
  })
  return data
}